package com.sxygsj.android.personnelscreen.plugin_jiguang.webserver.controller;

import android.content.Context;
import android.content.Intent;
import android.provider.Settings;

import com.yanzhenjie.andserver.annotation.PostMapping;
import com.yanzhenjie.andserver.annotation.ResponseBody;
import com.yanzhenjie.andserver.annotation.RestController;

@RestController
public class OpenSettingController {

    @ResponseBody
    @PostMapping("/openSetting")
    public String openSettig(Context context){
        try {
            Intent intent = new Intent(Settings.ACTION_SETTINGS);
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK );
            context.startActivity(intent);
            return "开启成功";
        }catch (Exception exception){
            return "开始失败";
        }
    }
}
